home *** CD-ROM | disk | FTP | other *** search
/ PsL Monthly 1993 December / PSL Monthly Shareware CD-ROM (December 1993).iso / prgmming / dos / basic / qlib.exe / INPUT.DOC < prev    next >
Encoding:
Text File  |  1992-05-10  |  22.1 KB  |  550 lines

  1.  
  2.   INPUT subroutines replace BASIC's INKEY$ or INPUT commands, and add
  3.   functions not available with BASIC alone.
  4.  
  5.  
  6.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  7.  
  8.     Subroutine: ClearKey
  9.     object file: clearkey.obj (getkey.obj)
  10.  
  11.         Removes all keypresses from the keyboard's "type ahead" buffer.
  12.     Works with standard and enhanced keyboards.
  13.  
  14.     Example:
  15.         CALL ClearKey
  16.  
  17.  
  18.  
  19.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  20.  
  21.     Function: keycode% = DGetKey
  22.     object file: dgetkey.obj
  23.  
  24.          Using DOS functions, DGetKey returns the ASCII character code of
  25.     the first keypress waiting in the keyboard buffer.  If the key code
  26.     returned > 255, then the key pressed is an extended keycode (such as
  27.     the function keys F1 - F10) and the ASCII code of the key is (code%
  28.     AND 255).  If no keypresses are waiting in the keyboard buffer,
  29.     DGetKey waits until a key is pressed before it returns to BASIC.
  30.     Unlike GetKey, below, input to DGeyKey may be redirected from the
  31.     command line.  DGeyKey does not support F11 or F12 function keys.
  32.     DGetKey allows ^C to pass through as keycode% = 3 without causing your
  33.     program to stop.  ^<Break> works the same as ^C in compiled programs;
  34.     in the QuickBASIC or QBX development enviornment, ^<break> causes
  35.     suspension of program operation (as it normally does).  See your BASIC
  36.     manual for ASCII character codes.
  37.  
  38.     Example:
  39.         REM $INCLUDE: 'qlib.bi'
  40.         keycode% = DGetKey
  41.         IF keycode% < 255 THEN PRINT CHR$(keycode%)   ' prints key pressed
  42.  
  43.  
  44.  
  45.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  46.  
  47.     Function: GPullDown(VARPTR(menu$(0)), choice0%, choice1%)
  48.     object files: gpulldn.obj (q$menu.obj and several others)
  49.               (for graphics modes)
  50.  
  51.     Function: PullDown(VARPTR(menu$(0)), choice0%, choice1%)
  52.     object files: pulldown.obj (q$menu.obj and several others)
  53.               (for text modes)
  54.  
  55.     Subroutine: MenuOption(optionnumber%, option% [option$ for option 6])
  56.     object file: q$menu.obj
  57.  
  58.     Requires QuickBASIC or BC7 without /fs switch
  59.     NOT for QBX development enviornment
  60.  
  61.     Pull-down menu system similar to the menus in the QuickBASIC
  62.     development environment.  You may specify initial main choice and
  63.     initial submenu choice (choice0% and choice1%).  PullDown returns to
  64.     BASIC when either ESC or RETURN is pressed, and returns the menu choice
  65.     in choice0% and choice1%.  Use cursor keys, home/end, pgup/pgdown or
  66.     mouse to move cursor.  PullDown will also jump to a menu choice when an
  67.     alphabetic key is pressed if that menu choice includes a capitalized
  68.     letter, and the key pressed matches the capital letter ("Hotkey"
  69.     feature).  Menu choices are disabled if all lower case.
  70.  
  71.     PullDown saves the screen under the menu, and restores the
  72.     previous screen when it exits.
  73.  
  74.     If choice1% (initial submenu choice) < 0, the main selections
  75.     will be printed without submenus.  You may move among the main
  76.     headings with left & right arrow keys or with the mouse.  Submenus
  77.     are displayed when Enter or any mouse buttons are pressed, or when
  78.     up or down arrows are pressed, or when the mouse pointer is moved up
  79.     or down.  Esc will erase the main headings and return to BASIC.
  80.  
  81.     MenuOption is used to specify colors.  Options supported are:
  82.  
  83.     option 0 = normal text color
  84.     option 1 = highlight color (menu choice)
  85.     option 2 = menu box color
  86.     option 3 = hotkey color
  87.  
  88.     If you do not specify colors, PullDown uses bright white text and
  89.     menu box, reverse video menu choice and hotkey color.
  90.  
  91.     Other options are:
  92.  
  93.     option 4 = user-specified exit key code (see GetKey for keycodes)
  94.     option 5 = exit when hotkey is pressed
  95.     option 6 = user-specified string printed at right edge of screen
  96.  
  97.     Any menu option may be canceled by setting the option = 0.
  98.  
  99.     Example:
  100.        see MENU.BAS example program
  101.  
  102.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  103.  
  104.     Function: keycode% = GetKey
  105.     object file: getkey.obj (asmflags.obj)
  106.  
  107.         Returns the ASCII character code of the first keypress waiting in
  108.     the keyboard buffer.  If the key code returned > 255, then the key
  109.     pressed is an extended keycode (such as the function keys F1 - F10)
  110.     and the ASCII code of the key is (code% AND 255).  If no keypresses are
  111.     waiting in the keyboard buffer, GetKey waits until a key is pressed
  112.     before it returns to BASIC.  GetKey supports F11 and F12 on 101-key
  113.     keyboards if the PC's BIOS also supports 101-key keyboards (See GetKBD).
  114.     See your BASIC manual for most ASCII character codes.
  115.  
  116.     ASCII character codes for F11 and F12 are not listed in some BASIC
  117.     manuals:
  118.                    with SHIFT     with CTRL      with ALT
  119.     F11       133       135            137            139
  120.     F12       134       136            138            140
  121.  
  122.     Example:
  123.          REM $INCLUDE: 'qlib.bi'
  124.          keycode% = GetKey
  125.          IF keycode% AND 256 THEN
  126.               keycode% = keycode% AND 255
  127.               IF keycode% = 138 THEN PRINT "CTRL+F12 was pressed"
  128.               ELSE
  129.            .
  130.            .
  131.            .
  132.          END IF
  133.  
  134.  
  135.  
  136.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  137.  
  138.     Subroutine: HideMouse
  139.     object file: mouse.obj (mousedat.obj)
  140.  
  141.          Makes the mouse cursor disappear.  The mouse driver continues to
  142.     track the mouse's motion and button status.
  143.  
  144.     Example:
  145.          HideMouse
  146.  
  147.  
  148.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  149.  
  150.     Subroutine: HideGMouse
  151.     object file: gmouse.obj (mousedat.obj, $graph.obj)
  152.  
  153.          Makes the alternate graphics mouse cursor disappear.  QLIB's
  154.     alternate mouse driver continues to track the mouse's motion.
  155.     See GMouse in GRAPHICS.DOC.
  156.  
  157.     Example:
  158.          HideGMouse
  159.  
  160.  
  161.  
  162.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  163.  
  164.     Function: k% = IsAlpha(keycode%)
  165.     object file: isalpha.obj
  166.  
  167.     Function: k% = IsDigit(keycode%)
  168.     Function: k% = IsLower(keycode%)
  169.     Function: k% = IsUpper(keycode%)
  170.     object file: isdlu.obj
  171.  
  172.          These function quickly determine if keycode% is an alphabetic
  173.     character (A-Z, a-z: IsAlpha), a numeric digit (0-9: IsDigit), a
  174.     lower-case alphabetic character (a-z: IsLower) or an upper-case
  175.     alphabetic character (A-Z: IsUpper).  k% = keycode% if keycode%
  176.     meets the function's search criteria, or k% = 0 if keycode is not
  177.     0-9, A-Z, or a-z (depending on the function).  Keycode% may be the
  178.     output of LineEdit, GLineEdit or the GetKey or DGetKey functions.
  179.  
  180.     Example:
  181.       REM $INCLUDE: 'qlib.bi'
  182.       REM I want to input only lowercase a-z
  183.  
  184. 10:   k% = IsLower(GetKey)
  185.       IF k% = 0 GOTO 10
  186.  
  187.  
  188.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  189.  
  190.     Function: k% = KeyFilter(s1$, s2$, keycode%)
  191.     object file: keyfilt.obj
  192.  
  193.         KeyFilter compares keycode% to each character in the strings
  194.     s1$ and s2$, and returns k% = 0 unless keycode% matches a character
  195.     in the search strings.  If keycode% is a normal character (i.e., not
  196.     a function key), then s1$ is used.  If keycode% is an extended keycode,
  197.     (keycode% > 255) then s2$ is used.  See example.
  198.  
  199.     Example:
  200.     REM $INCLUDE: 'qlib.bi'
  201.     REM  I want to input only the letters a, c and g (upper or lower case)
  202.     REM  and I also want to watch for F10 (keycode% = 256 OR 68)
  203.     s1$ = "aAcCgG"
  204.     s2$ = CHR$(68)
  205. 10: k% = KeyFilter(s1$, s2$, keycode%)
  206.     IF k% = 0 GOTO 10
  207.  
  208.     REM  Note that KeyFilter may also be called using one of QLIB's input
  209.     REM  functions such as GetKey, DGetKey or KeyIfWaiting like this:
  210.     REM  10: k% = KeyFilter(s1$, s2$, KeyIfWaiting)
  211.     REM      IF k% = 0 GOTO ...
  212.  
  213.  
  214.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  215.  
  216.     Function: keycode% = KeyIfWaiting
  217.     object files: kifwait.obj (getkey.obj, asmflags.obj)
  218.  
  219.     Uses BIOS calls to determine whether a key is waiting in the keyboard
  220.     buffer, returning the key to BASIC.  If no key is waiting, KeyIfWaiting
  221.     returns keycode% = 0.  KeyIfWaiting supports F11 and F12 keys on 101-key
  222.     keyboards if the PC's BIOS also supports these keyboards.
  223.  
  224.     Example:
  225.          keycode% = KeyIfWaiting
  226.  
  227.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  228.  
  229.     Subroutine: KeyOrButton(buttons%, keycode%)
  230.     object files: mouse.obj (getkey.obj)
  231.  
  232.     Returns first key pressed or mouse button pressed.  If no key is waiting
  233.     in the keyboard buffer and no mouse button is pressed, KeyOrButton waits
  234.     until one of these events happens.  If a key is waiting in the keyboard
  235.     buffer before KeyOrButton is called, the key is returned to QB without
  236.     checking mouse buttons.  Buttons% = 0 if a key has been read, otherwise
  237.     buttons% indicates which buttons are pressed.  See GetKey for key codes,
  238.     and see the example below for buttons% codes.  More than one button may
  239.     be pressed.
  240.  
  241.     Example:
  242.         CALL KeyOrButton(buttons%, keycode%)
  243.         msg$ = ""
  244.         IF buttons% THEN
  245.                IF buttons% AND 1 THEN msg$ = "left button pressed "
  246.                IF buttons% AND 2 THEN msg$ = msg$ + "right button pressed "
  247.                IF buttons% AND 4 THEN msg$ = msg$ + "center button pressed"
  248.                PRINT msg$
  249.                ELSE
  250.                            ' action for key pressed
  251.         END IF
  252.  
  253.  
  254.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  255.  
  256.     Function: a% = KeyWaiting
  257.     object file: getkey.obj (asmflags.obj)
  258.  
  259.     Uses BIOS calls to determine whether a key is waiting in the keyboard
  260.     buffer, without reading the key.  KeyWaiting supports F11 and F12 keys on
  261.     101-key keyboards if the PC's BIOS also supports these keyboards.
  262.  
  263.     Example:
  264.          REM $INCLUDE: 'qlib.bi'
  265.          IF KeyWaiting% THEN PRINT "A key has been pressed"
  266.  
  267.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  268.  
  269.     Subroutine: LineEdit(st$, row%, col%, attr%, options%, keycode%)
  270.     Subroutine: StartEdit(startcol%)
  271.     Function: LastEdit
  272.     object files: lineedit.obj (crt.obj, q$qprn.obj, cursor.obj, getkey.obj)
  273.  
  274.          LineEdit displays st$ at (row%, col%) and provides many editing
  275.     functions, returning the edited string to BASIC.  The length of st$
  276.     will not change during the editing process.  Options are provided to
  277.     restrict legal input or to provide additional information, depending on
  278.     the bits set in options%.  See LineEdit's Summary of Commands, below.
  279.     See GetKey to interpret the keycode% returned by LineEdit.
  280.          StartEdit may be used before calling LineEdit in order to begin or
  281.     resume editing at a specified position in st$ (default position is
  282.     1, the left end of the string).  LastEdit is used after LineEdit returns
  283.     to BASIC, to determine the cursor position in st$ when control was
  284.     returned to BASIC.
  285.          LineEdit turns the cursor off when returning to BASIC.  You may
  286.     use BASIC's LOCATE command or QLIB's CursorON subroutine to restore
  287.     the cursor.  LineEdit works only in text mode.  Use GLineEdit in graphics
  288.     modes (See GLineEdit in GRAPHICS.DOC.).  LineEdit will edit any string up
  289.     to 32,767 bytes long.  See also WindowEdit.
  290.  
  291.     Thanks to Thomas Cullins for his bug report on the BC7/QBX version of
  292.     LineEdit.
  293.  
  294.      Summary of LineEdit commands:
  295.  
  296.      Enter, Esc = return string to BASIC
  297.      Left arrow, Right arrow = move cursor
  298.      Insert = toggle insert/overstrike modes
  299.      Home = move cursor to start of line
  300.      End = move cursor to end of text
  301.      Delete = delete character at cursor and close up space
  302.      Backspace = move cursor back one space, delete character, and close space
  303.      Ctrl+End = clear from cursor to end of line
  304.      Ctrl+Left, Ctrl+Right = move cursor one word
  305.  
  306.      LineEdit options and examples are on the next page.
  307.  
  308.  
  309.      LineEdit options:
  310.  
  311.      1 = Lower Case
  312.      2 = Upper Case
  313.      1 + 2 = Numerals only
  314.      1 + 2 + 4 = Numerals and numeric punctuation ($,.%-+*/)
  315.      8 = use BIOS to display string (default is DVM)
  316.      32 = Return to BASIC if cursor is past end of string
  317.      64 = Return to BASIC if normal key pressed
  318.      128 = Return to BASIC if extended key (F1 - F10, etc.) is pressed.
  319.               NOTE: if this option is used and an extended key is pressed,
  320.               keycode% returned as 256 + the ASCII code of the extended
  321.               key.  This may be used along with StartEdit and LastEdit
  322.               to trap specified extended key presses.  See examples.
  323.      256 = Return to calling program if ALT key is pressed.  keycode%
  324.               is returned = 256.
  325.      -32768 = Use alternate reverse video cursor instead of the blinking
  326.               hardware cursor.  This option may cause "snow" on CGA monitors.
  327.               The cursor position is indicated by a black character on a
  328.               white background; in insert mode, either the character blinks
  329.               or the background is high intensity, depending on the last call
  330.               to SetBLINK (see VIDEO.DOC).  To preserve compatability with
  331.               future versions of LineEdit, do not use this option with
  332.               option 8.  This version of LineEdit ignores option -32768 if
  333.               option 8 is used.
  334.  
  335.     Use BASIC's OR operator to combine options.
  336.  
  337.     Example 1:
  338.          st$ = "This is the string to be edited              "
  339.                                   ' extra spaces allow for inserted characters
  340.          row% = 5: col% = 10
  341.          options% = 0             ' allow all characters, no fancy stuff
  342.          CALL LineEdit(st$, row%, col%, attr%, options%, keycode%)
  343.  
  344.     Example 2:
  345.          REM $INCLUDE: 'qlib.bi'
  346.          st$ = "This is the string to be edited": row% = 5: col% = 10
  347.          options% = 2 OR 128 ' All text input converted to upper case and
  348.                              ' return to calling program if extended key
  349.                              ' pressed.
  350.                              ' I want to trap F1, which returns the ASCII
  351.                              ' code a% = 59 (see your BASIC manual for
  352.                              ' extended key codes)
  353. 10       CALL LineEdit(st$, row%, col%, attr%, options%, keycode%)
  354.          IF keycode% AND 256 THEN
  355.               a% = keycode% AND 255
  356.               IF a% = 59 THEN ...      ' do F1 stuff
  357.                                        '    else go back to LineEdit:
  358.               CALL StartEdit(LastEdit) ' re-set cursor location
  359.               GOTO 10                  ' and go back to LineEdit
  360.          END IF
  361.  
  362.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  363.  
  364.     Function: keycode% = MaskEdit(mask$, row%, column%, attr%, options%)
  365.     object file: maskedit.obj (getkey.obj, qprint.obj, cursor.obj)
  366.  
  367.          Permits a string with fixed fields and fixed delimiters to be
  368.     edited.  This can be used, for example, to input telephone numbers
  369.     or ZIP codes, or other fixed-field data.  MaskEdit will permit only
  370.     the characters in the input string which are numbers, letters or
  371.     space characters to be edited, skipping over field delimiters.
  372.     MaskEdit will optionally limit input to numerals, or will force
  373.     lower-case input, or upper-case input.  MaskEdit returns to your
  374.     BASIC program when either ESC or ENTER is pressed.  MaskEdit options
  375.     are:
  376.  
  377.        1 = a-z forced to upper case 
  378.        2 = A-Z forced to lower case 
  379.        3 = numerals only allowed
  380.  
  381.     row% and column% are the location on the screen where you want
  382.     the string to be printed, and attr% is the color attribute to be used.
  383.     You may use the TAB key to jump from one field to the next, and
  384.     shift+TAB jumps the cursor back to the previous field.  You may also
  385.     use the left, right, home and end keys to move the cursor.
  386.  
  387.     Example:
  388.        REM $INCLUDE: 'qlib.bi'
  389.        REM  define the mask for entering telephone numbers
  390.        REM  I'm using CHR$(255) as a non-editable space character
  391.        mask$ = "(   )"+CHR$(255)+"   -    "
  392.        phone$ = mask$                 ' don't disturb mask$
  393.        options% = 3
  394.        keycode% = MaskEdit(phone$, row%, column%, attr%, options%)
  395.        IF keycode% = 27 THEN          ' ESC was pressed
  396.  
  397.  
  398.  
  399.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  400.  
  401.     Subroutine: MouseStatus(x%, y%, buttons%)
  402.     object file: mstatus.obj (mousedat.obj)
  403.  
  404.          Returns the mouse button status and mouse position.  Buttons% is
  405.     a code which indicates which mouse buttons, if any, are pressed, and
  406.     the PIXEL coordinates of the mouse cursor, even in text modes.
  407.     Pixel coordinates start with (0,0) in the upper left corner.
  408.     X-coordinates are horizontal and Y-coordinates are vertical (increasing
  409.     from top of screen to bottom).  See KeyOrButton to decode buttons%.
  410.     To determine mouse cursor position in terms of text locations, see
  411.     TMouseStatus.
  412.  
  413.     Example:
  414.          CALL MouseStatus(x%, y%, buttons%)
  415.  
  416.  
  417.  
  418.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  419.  
  420.     Subroutine: ShowMouse
  421.     object file: mouse.obj (mousedat.obj)
  422.  
  423.          ShowMouse makes the mouse cursor visible.
  424.  
  425.     Example:
  426.          CALL ShowMouse
  427.  
  428.  
  429.  
  430.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  431.  
  432.     Subroutine: ShowGMouse
  433.     object file: gmouse.obj (mousedat.obj, $graph.obj)
  434.  
  435.          ShowGMouse makes the alternate graphics mouse cursor visible.
  436.     See GMouse in GRAPHICS.DOC.
  437.  
  438.     Example:
  439.          CALL ShowGMouse
  440.  
  441.  
  442.  
  443.  
  444.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  445.  
  446.     Subroutine: TMouseStatus(col%, row%, buttons%)
  447.     object file: tmstatus.obj
  448.  
  449.     TMouseStatus is similar to MouseStatus, but returns the mouse cursor's
  450.     position as (col%, row%) character coordinates instead of pixel
  451.     coordinates.  Note that most QLIB subroutines use column and row
  452.     coordinates in reverse order (row%, col%) instead of TMouseStatus'
  453.     (col%, row%).  Buttons% is the mouse's button status.  See KeyOrButton
  454.     to decode button status.
  455.  
  456.     Example:
  457.          CALL TMouseStatus(col%, row%, buttons%)
  458.  
  459.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  460.  
  461.     Function: keycode% = VertList(VARPTR(a$(0)), row%, col%, choice%)
  462.     object files: vlist.obj (q$menu.obj, getkey.obj, crt.obj, q$qprn.obj,
  463.                              several others)
  464.  
  465.     Requires QuickBASIC or BC7 without /fs switch
  466.     NOT for QBX development enviornment
  467.  
  468.     Vertical list menu system; requires an array of varable-length strings,
  469.     upper left corner coordinates (row%, col%) and starting position
  470.     (choice%).  VertList returns to QuickBASIC when Esc, Enter or an
  471.     optional user-defined exit key is pressed, or when a mouse button is
  472.     pressed.  The keycode of the key pressed is returned as keycode% and
  473.     the menu selection is returned as choice%.  VertList uses all menu
  474.     options except option 6 (user-specified prompt string).  See MenuOption.
  475.  
  476.     Example:
  477.     REM $INCLUDE: 'qlib.bi'
  478.  
  479.     DIM mainmenu$(9)      ' 10 menu strings, 0-9; last string is NUL
  480.     FOR I= 0 TO 9
  481.       READ mainmenu$(I)   ' strings are in a DATA statement
  482.                           ' end of menu string data marked with a NUL string
  483.     NEXT I
  484.     row% = 5: col% = 10: choice% = 0
  485.                           ' "light bar" positioned at mainmenu$(0)
  486.     mm% = VARPTR(mainmenu$(0))
  487.     keycode% = VertList(mm%, row%, col%, choice%)
  488.  
  489.  
  490.  
  491.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  492.  
  493.     Subroutine: WindowEdit(st$, r0%, c0%, r1%, c1%, attr%, options%, keycode%)
  494.     Subroutine: WStartEdit(start%)
  495.     Function: WLastEdit
  496.     object files: wedit.obj (qprintw.obj(crt.obj, q$qprn.obj, q$clrw.obj),
  497.                              cursor.obj, getkey.obj)
  498.  
  499.          Similar to LineEdit, WindowEdit edits the string st$ in a window on
  500.     a text-mode screen and returns the result to BASIC.  WindowEdit is still
  501.     in the early stages of development; your comments and suggestions will
  502.     influence my development of this subroutine.
  503.  
  504.     WindowEdit differs from LineEdit in that it includes word wrap and
  505.     up/down cursor movement, and varies the length of the string st$, depending
  506.     on text inserted or deleted.  WindowEdit does not yet scroll to allow
  507.     editing strings longer than the window can display (but this is on my
  508.     list of enhancements).  WindowEdit also does not yet use any options%.
  509.     Note that you should use options% = 0 for compatability with future
  510.     versions of WindowEdit.  WStartEdit and WLastEdit are used with
  511.     WindowEdit as StartEdit and LastEdit are used with LineEdit.
  512.  
  513.     Summary of WindowEdit commands:
  514.  
  515.      Enter, Esc = return string to BASIC
  516.      Left, Right, Up, Down arrows = move cursor
  517.      Insert = toggle insert/overstrike modes
  518.      Home = move cursor to start of line
  519.      End = move cursor to end of line
  520.      Delete = delete character at cursor and close up space
  521.      Backspace = move cursor back one space, delete character, and close space
  522.      Ctrl+Left, Ctrl+Right = move cursor one word
  523.  
  524.  
  525.  
  526.  
  527.  ░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
  528.  
  529.     Function: YesNo
  530.     object file: yesno.obj
  531.  
  532.          Waits for either "Y" or "N" to be pressed, then returns the ASCII
  533.     character code of the key pressed.  The character code returned will be
  534.     the code for UPPER case "Y" or "N", regardless of whether the key pressed
  535.     was upper or lower case.
  536.  
  537.     Example:
  538.          REM $INCLUDE: 'QLIB.BI'
  539.          PRINT "Are you sure? (Y/N)"
  540.          REM  ASC("Y") = 89, ASC("N") = 78
  541.          IF YesNo = 89 THEN
  542.                    .         ' instructions for Y response
  543.                    .
  544.                    .
  545.               ELSE
  546.                    .         ' instructions for N response
  547.                    .
  548.                    .
  549.          END IF
  550.